package com.starsea.book.ui.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * @author Lee
 * @createTime 2023-08-02 11 GMT+8
 * @desc :
 */
class MyFragmentStateAdapter(
  var fragmentList: MutableList<Fragment>,
  fragmentActivity: FragmentActivity
) : FragmentStateAdapter(fragmentActivity) {

  override fun getItemCount(): Int {
    return fragmentList.size
  }

  override fun createFragment(position: Int): Fragment {
    return fragmentList[position]
  }
}